<?php
class programme_cpl_category extends Model{
	public static function getTableName(){
		return 'programme-cpl_category';
	}

	public function delBySql($id)
	{
		$sql = "delete from ".self::getTableName()." where programme_id='{$id}'";
		return Model::$dbo["w"]->getDbHandle()->exec($sql);
	}

	public function getCategoryByProgrammeID($id)
	{
		$sql = "select *  from `".self::getTableName()."` a,cpl_category b where a.programme_id='{$id}' and a.category_id=b.id";
		return Model::$dbo["r"]->findBySql(__class__, $sql);
	}
}
?>
